import { InterfaceProxy } from 'mider'
import { defaultOptions } from './_options'

/**
 * 工具
 * @namespace iUser
 */

/** @lends iUser# */
const interfaceOpt = {
  login: {
    url: '/v1/user-api/actions/login',
    method: 'post'
  },
  registry: {
    url: '/v1/user-api/actions/registry',
    method: 'post'
  },
  changePassword: {
    url: '/v1/user-api/actions/changePassword',
    method: 'post'
  },
  getCurrentUser: {
    url: '/v1/user-api/me',
    method: 'get'
  },
  logout: {
    url: '/v1/user-api/logout',
    method: 'get'
  },
  feedback: {
    url: '/v1/user-api/feedback',
    method: 'post'
  }
}

/** @mixes iUser */
const iUser = new InterfaceProxy(interfaceOpt, [defaultOptions])

export default iUser
